package aptech.eproject.logictics.db;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The persistent class for the TRIP_PACKAGE database table.
 * 
 */
@Entity
@Table(name = "TRIP_PACKAGE")
public class TripPackage implements Serializable {

    private static final long serialVersionUID = 1L;
    private TripPackagePK id;
    private boolean isUnloaded;
    private Package pack;
    private Trip trip;

    public TripPackage(TripPackagePK id, boolean isUnloaded) {
        this.id = id;
        this.isUnloaded = isUnloaded;
    }

    public TripPackage() {
    }

    @EmbeddedId
    public TripPackagePK getId() {
        return this.id;
    }

    public void setId(TripPackagePK id) {
        this.id = id;
    }

    @Column(name = "IS_UNLOADED", nullable = true)
    public boolean getIsUnloaded() {
        return this.isUnloaded;
    }

    public void setIsUnloaded(boolean isUnloaded) {
        this.isUnloaded = isUnloaded;
    }

    //bi-directional many-to-one association to Package
    @ManyToOne
    @JoinColumn(name = "PACKAGE_ID", insertable = false, updatable = false)
    public Package getPackage() {
        return pack;
    }

    public void setPackage(Package pack) {
        this.pack = pack;
    }

    //bi-directional many-to-one association to Trip
    @ManyToOne
    @JoinColumn(name = "TRIP_ID", insertable = false, updatable = false)
    public Trip getTrip() {
        return this.trip;
    }

    public void setTrip(Trip trip) {
        this.trip = trip;
    }
}
